<?php
class Mvolume extends CI_Model{
    
    public function __construct(){
        parent::__construct();
        $this->load->database();
    }

    public function getVolume(){
        $this->db->select('*');
        $this->db->from('volume');
        $query = $this->db->get();
        return $query->result_array();
    }
    
    public function getVolumeByBookID($bookID){
        $this->db->select('volume.no as volume_no, volume.name as volume_name, volume.book_id as volume_book_id');
        $this->db->from('volume');
        $this->db->where("volume.book_id", $bookID);
        $query = $this->db->get();
        return $query->result_array();
    }
}
?>